﻿using MiniExcelLibs.Attributes;
using SqlSugar;
using System;

namespace Qy.Scenario;

[SugarTable(DbTableName.QyLogSql)]
public class LogSql
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int UserId { get; set; }
    public string ControllerAction { get; set; }
    public string Ip { get; set; }
    public DateTime Time { get; set; }
    public string DoThing { get; set; }
    public string Name { get; set; }
}

public class ViewLogSql
{
    [ExcelColumn(Name = "Id")]
    public int Id { get; set; }
    [ExcelColumn(Name = "用户ID")]
    public int UserId { get; set; }
    [ExcelColumn(Name = "操作名称")]
    public string Name { get; set; }
    [ExcelColumn(Name = "行为方法")]
    public string ControllerAction { get; set; }
    [ExcelColumn(Name = "IP")]
    public string Ip { get; set; }
    [ExcelColumn(Name = "操作时间", Format = "yyyy-MM-dd HH:mm:ss")]
    public DateTime Time { get; set; }
    [ExcelColumn(Name = "详细内容")]
    public string DoThing { get; set; }
    [ExcelColumn(Name = "操作人单位")]
    public string DeptName { get; set; }
    [ExcelColumn(Name = "操作人")]
    public string NickName { get; set; }
}


/// <summary>
/// 查询模型
/// </summary>
public class LogSqlQuery : PagerInfo
{
    public int Uid { get; set; }
    public bool ExportExcel { get; set; } = false;
    public string NickName { get; set; }
    public DateTime? StartDate { get; set; }
    public DateTime? EndDate { get; set; }
}